/*
Copyright 2022 BarD Software s.r.o

This file is part of GanttProject, an open-source project management tool.

GanttProject is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

GanttProject is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GanttProject.  If not, see <http://www.gnu.org/licenses/>.
*/
@import "theme";
@import "buttons";
@import "menu";

.toolbar-common {
  -fx-background-color: transparent;

  Button {
    @include btn-toolbar-common();
  }

  Separator {
    -fx-min-width: 2em;
    -fx-border-style: none;

    .line {
      -fx-border-style: none;
      -fx-border-width: 0;
    }
  }
}

.toolbar-small {
  -fx-alignment: center-left;
  -fx-padding: 0;
  -fx-border-width: 0;
  -fx-border-insets: 0;
  -fx-spacing: 0;

  Button {
    @include btn-toolbar-small();
  }
}

.toolbar-chart {
  &.align-right {
    -fx-alignment: center-right;
  }
  & *.app-font-small {
    -fx-font-size: 11px;
  }
  & *.app-font-normal {
    -fx-font-size: 13px;
  }
  & *.app-font-large {
    -fx-font-size: 16px;
  }
  & *.app-font-larger {
    -fx-font-size: 20px;
  }
  & *.app-font-huge {
    -fx-font-size: 22px;
  }

  -fx-padding: 0 5 0 5;
  Button {
    -fx-alignment: center-left;
    -fx-background-color: transparent;
    -fx-background-insets: 0;
    -fx-padding: 0 5 0 5;
    -fx-border-width: 0;
    -fx-text-alignment: center;

    .glyph-icon {
      -glyph-size: 22px;
      -fx-padding: 0;
    }

    &:hover {
      -fx-background-radius: 0 0 3 3;
    }
    &:focused {
      @include btn-hovered(transparent);
      @include btn-focused($gp-light-gray, transparent);
      -fx-background-radius: 0 0 3 3;
    }
  }

  .combo-box-base  {
    & > .list-cell {
      -fx-alignment: center-right;
      -fx-text-fill: $gp-medium-gray;
      -fx-max-height: 24px;
      -fx-pref-height: 24px;
      -fx-padding: 0 5 0 5;
      -fx-border-width: 0;
      -fx-background-insets: 0;
    }
    @include btn-normal(transparent, transparent);

    .arrow-button {
      @include btn-normal(transparent, transparent);
    }

    &:hover {
      @include btn-hovered(transparent, derive($gp-light-gray, -10%));
      .arrow-button {
        @include btn-hovered(transparent, derive($gp-light-gray, -10%));
      }
    }

    &:focused {
      @include btn-hovered(transparent);
      @include btn-focused($gp-light-gray, transparent);

      .arrow-button {
        @include btn-hovered($gp-light-gray, transparent);
      }
      -fx-background-radius: 0 0 5 5;
    }

    &:disabled {
      -fx-opacity: .4;
    }
    -fx-max-height: 24px;
    -fx-pref-height: 24px;
    -fx-padding: 0;
    -fx-border-width: 0;
    -fx-background-insets: 0;
    -fx-border-insets: 0;
    -fx-background-radius: 0 0 5 5;
  }
}

.toolbar-main {
  -fx-padding: 1ex 0 10 0;
  -fx-border-insets: 0 20 0 20, 0 20 5 20;
  -fx-border-color: #ffd700, #0057b7;
  -fx-border-width: 0 0 5 0, 0 0 5 0;

  GridPane {
    -fx-alignment: center;

    CustomTextField {
      -fx-border-color: $gp-medium-gray;
      -fx-border-radius: 3px;

      .glyph-icon {
        -fx-cursor: hand;
      }
    }
  }
}

.toolbar-big Button {
  -fx-min-width: 40px;
  -fx-min-height: 40px;

  .glyph-icon {
    -glyph-size: 32px;
  }

  &:hover {
    .glyph-icon {
      -glyph-size: 32px;
    }
  }
}

.progress-bar {
  /*-fx-background-color:*/
  /*        -fx-box-border,*/
  /*        linear-gradient(to bottom, derive(-fx-color,30%) 5%, derive(-fx-color,-17%));*/
  -fx-background-color: transparent;
  -fx-border-style: none;
  -fx-border-width: 0;
  -fx-max-width: 100500;
  -fx-indeterminate-bar-escape: true;
  -fx-indeterminate-bar-flip: true;
  -fx-indeterminate-bar-animation-time: 5;

  .bar {
    /*-fx-background-color:*/
    /*        -fx-box-border,*/
    /*        linear-gradient(to bottom, derive(-fx-accent,95%), derive(-fx-accent,10%)),*/
    /*        linear-gradient(to bottom, derive(-fx-accent,38%), -fx-accent);*/
    -fx-border-style: none;
    -fx-border-width: 0;
    -fx-padding: 0.416667em; /* 5 */
  }

  .track {
    /*-fx-background-color:*/
    /*        -fx-box-border,*/
    /*        linear-gradient(to bottom, derive(-fx-color,-15%), derive(-fx-color,2.2%) 20%, derive(-fx-color,60%));*/
    -fx-background-color: transparent;
    -fx-background-insets:  0, 1;
  }

  &:indeterminate {
    .bar {
      /*-fx-background-color: linear-gradient(to left, transparent, -fx-accent);*/
    }
  }

  &:disabled {
    -fx-opacity: -fx-disabled-opacity;
  }
}

.task-filter {
  Label {
    -fx-padding: 3 5 0 0;
    -fx-text-fill: $gp-medium-gray;
  }

  @include context-menu();
}